﻿using OA.Model.MyAttribute;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
//using System.Web.DynamicData;

namespace OA.Model
{
    //[TableName("表单分组表")]
    [Table("FormGroup")]
    public class FormGroup :BaseInfo
    {
        public int Status { get; set; }

        [Display(Name = "分组名称")]
        [MaxLength(10)]
        [Required]
        [Tag(TagEnum.Text, "required", "分组名称", 3, 10)]
        public string Name { get; set; }

        [Display(Name ="排序")]
        [Tag(TagEnum.Number, "required", "分组排序", 0, 100)]
        public int Sort { get; set; }

        public virtual ICollection<CustomForm> CustomForms { get; set; }

    }

    public class SimpleFormGroup:SimpleInfo
    {        
        public string Name { get; set; }

        public int Sort { get; set; }

        public static Expression<Func<FormGroup, SimpleFormGroup>> Map = m => new SimpleFormGroup()
        {
            ID = m.ID,
            Name = m.Name,
            Sort=m.Sort
        };
    }
}
